<?
                    echo "No.";
                    $col_count = 1; 
                    //print_object($dgcolumns);exit;
                    foreach($dgcolumns as $key => $column) {
                        if($column['visible']) {
                            $widthstr = '';
                            if(isset($column['width'])) {
                                $width = $column['width'];
                                $widthstr = " width=\"".$width."\"";
                            }
                            if(strpos($column['label'],",")) { $column['label'] = '"'.$column['label'].'"'; }
                            echo ",".$column['label'];
                            $col_count++;    
                        }                    
                    } 
                
                echo "\n";
                
                $i = ($current_page-1)*$rows_per_page + 1; 
                foreach($dgitems as $dgitem) {
                    echo $i;
                foreach($dgcolumns as $key => $column) {
                    if($column['visible']) {
                        $colvalue = $dgitem[$key];
                        switch($column['type']) {
                            case 'boolean':
                                    $colvalue = ($colvalue == true) ? 'Yes' : 'No';
                                    break;
                            case 'date':
                                    $colvalue = ($colvalue!="0000-00-00") ? date("Y-m-d",strtotime( $colvalue )) : "";
                                    break;
                            case 'enum':
                                    $colvalue =  $column['enum'][$colvalue];
                                    break;  
                        }
                        if($colvalue!="") {
                            if(strpos($colvalue,",")) { $colvalue = '"'.$colvalue.'"'; }
                        }
                        echo ",".$colvalue;
                    }
                }
                    echo "\n";
                    $i++;      
                }            
            ?>